<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>深圳在线预约诊疗服务平台</title>
    <link rel="stylesheet" href="public/css/lib/bootstrap.min.css" tppabs="https://guahao.zjol.com.cn/public/css/lib/bootstrap.min.css">
    <link rel="stylesheet" href="public/css/lib/glider.min.css" tppabs="https://guahao.zjol.com.cn/public/css/lib/glider.min.css">
    <link rel="stylesheet" href="public/css/lib/bootstrap-datepicker.min.css" tppabs="https://guahao.zjol.com.cn/public/css/lib/bootstrap-datepicker.min.css">
    <link rel="stylesheet" href="public/css/lib/jquery-confirm.min.css" tppabs="https://guahao.zjol.com.cn/public/css/lib/jquery-confirm.min.css">


    <!-- <link rel="stylesheet" href="/public/css/lib/material-icons.css">
    <link rel="stylesheet" href="/public/css/lib/bootstrap-material-design.min.css" > -->

    <link rel="stylesheet" href="public/css/global.css" tppabs="https://guahao.zjol.com.cn/public/css/global.css">


    <link rel="stylesheet" href="public/css/login.css" tppabs="https://guahao.zjol.com.cn/public/css/login.css">

</head>

<body>

<div class="login-box">
    <div class="login-container clearfix">
        <div class="login-left float-left">

        </div>
        <div class="login-right float-left">
            <div class="login-title">
                <a href="login1.html" tppabs="https://guahao.zjol.com.cn/register" style="color: #2f2f2f;">医生登录</a>
                <span class="active">登录</span>
                <a href="register.htm" tppabs="https://guahao.zjol.com.cn/register" style="color: #2f2f2f;">注册</a>
            </div>
            <div class="login-content">

                <div class="login-item">
                    <div class="login-item-name">手机号<span class="login-ntf name" id="phone2"></span></div>
                    <div class="login-item-ipt">
                        <input type="text" class="form-control username-ipt" placeholder="请输入手机号" id="phone">
                    </div>

                </div>

                <div class="login-item">
                    <div class="login-item-name">手机验证码<span class="login-ntf name" id="captcha2"></span></div>
                    <div class="login-item-ipt clearfix">
                        <div class="float-left" style="width: 60%;">
                            <input type="text" class="form-control verify-ipt" placeholder="请输入手机验证码" id="captcha">
                        </div>
                        <div class="float-left" style="width: 40%; padding-left: 30px;">
                            <button type="button" id="verify-btn" class="btn btn-success btn-block">获取验证码</button>
                        </div>
                    </div>
                </div>
                <div style="margin-top: 20px;">
                    <button class="btn btn-success btn-block" id="submit" type="submit">登&nbsp;&nbsp;录</button>
                </div>


            </div>
        </div>
    </div>
</div>

</body>
<script src="../admin/js/jquery.js"></script>
<script>
    $(function() {
        $("#submit").click(function () {
            var phone = $("#phone").val();
            var sms = $("#captcha").val();
            var token =  localStorage.getItem("token");
            var  head = new Headers();
            head.append('token',token);
            $.ajax({
                type: "post",
                url: "/hospital/api/user/login/sms",
                data: {"phone": phone, "sms": sms},
                dataType: "json",
                headers: {
                    'token':token
                },
                success: function (data) {
                    alert(data.data)
                    localStorage.setItem("token", request.getResponseHeader("token"));
                    location.href = "home.html";
                }
            })
        })
    })
    $(function(){
        $("#verify-btn").click(function(){
            var phone=$("#phone").val();
            var codeType=1;
            $.ajax({
                type: "post",
                url: "/hospital/api/sms/verfycode",
                data: {
                    "codeType":codeType,
                    /* sms: sms,*/
                    "phone": phone
                },
                dataType: "json",
                success: function (data) {

                }
            })
        })
    })

    $(function(){
        $("#wx").click(function(){
            $.ajax({
                type: "get",
                url: "/hospital/api/user/login/wechat",
                dataType: "json",
                success: function (data) {
                    location.href=data.data
                }
            })
        })
    })
</script>

</html>